'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let vk = uniCloud.vk;
	// 逻辑
	
	let rtn = await vk.baseDao.selects({
	  dbName: "db-book-keeping-data",
	  pageIndex: 1,
	  pageSize: 10000,
	  getCount: false,
	  // 主表where条件
	  whereJson: {
		  
	  },
	  // 主表排序规则
	  sortArr: [{ name:"date", type:"desc" }],
	  // 副表列表
	  foreignDB: [
	    {
	      dbName: "db-book-relation-data",
		  // 主表外键名
	      localKey: "_id",
	      foreignKey: "dataId",
	      as: "dataList",
	      limit: 1,
		  whereJson:{
			bookId:_.eq("237b8319ece41a2eed99ff955012b41d")
		  },
	    }
	  ],
	  
	});
	
	console.log(rtn)
	//返回数据给客户端
	return event
};
